package com.yanqu.road.entity.activity.youxing;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;

@FieldTypeAnnotation(tableName = "t_c_xing_you_data", desc = "行游山水活动数据")
public class CrossXingYouShanShuiData extends DataObject {

    @FieldTypeAnnotation(select = true, update = true, desc = "活动ID")
    private int activityId;

    @FieldTypeAnnotation(update = true, desc = "分组id")
    private int groupId;

    @FieldTypeAnnotation(desc = "妈祖庙-玩家")
    private long userId;

    @FieldTypeAnnotation(desc = "妈祖庙-进驻队伍血量")
    private long totalHp;

    @FieldTypeAnnotation(desc = "妈祖庙-进驻队伍当前血量")
    private long hp;

    @FieldTypeAnnotation(desc = "妈祖庙-变更时间")
    private long maZuChangeTime;

    @FieldTypeAnnotation(desc = "每日重置时间")
    private long dayRestTime;

    @FieldTypeAnnotation(desc = "妈祖庙-进驻队伍")
    private List<ShanShuiBeauty> beautyList;

    //cache
    private AtomicBoolean needSync = new AtomicBoolean(false);

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public int getGroupId() {
        return groupId;
    }

    public void setGroupId(int groupId) {
        if(this.groupId != groupId) {
            this.groupId = groupId;
            setUpdateOption();
        }
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if(this.userId != userId) {
            this.userId = userId;
            setUpdateOption();
        }
    }

    public long getTotalHp() {
        return totalHp;
    }

    public void setTotalHp(long totalHp) {
        if(this.totalHp != totalHp) {
            this.totalHp = totalHp;
            setUpdateOption();
        }
    }

    public long getHp() {
        return hp;
    }

    public void setHp(long hp) {
        if(this.hp != hp) {
            this.hp = hp;
            setUpdateOption();
        }
    }

    public List<ShanShuiBeauty> getBeautyList() {
        return beautyList;
    }

    public AtomicBoolean isNeedSync() {
        return needSync;
    }

    public void setNeedSync(AtomicBoolean needSync) {
        if(this.needSync != needSync) {
            this.needSync = needSync;
            setUpdateOption();
        }
    }

    public void setBeautyList(List<ShanShuiBeauty> beautyList) {
        this.beautyList = beautyList;
        setUpdateOption();
    }

    public long getMaZuChangeTime() {
        return maZuChangeTime;
    }

    public void setMaZuChangeTime(long maZuChangeTime) {
        if(this.maZuChangeTime != maZuChangeTime) {
            this.maZuChangeTime = maZuChangeTime;
            setUpdateOption();
        }
    }

    public long getDayRestTime() {
        return dayRestTime;
    }

    public void setDayRestTime(long dayRestTime) {
        if(this.dayRestTime != dayRestTime) {
            this.dayRestTime = dayRestTime;
            setUpdateOption();
        }
    }
}
